<template>
	<z-paging ref="paging" v-model="dataList" @query="queryList"
		:loading-more-custom-style="{ paddingBottom: 'env(safe-area-inset-bottom)' }">
		<template #top>
			<view class="zpagin_top">
				<nav-bar :iconLeft="true" />
				<view class="search">
					<custom-search v-model="queryParams.search" @search="refreshList" placeholder="请输入生产单号/工序名称" />
				</view>
			</view>
		</template>
		<uni-card v-for="item in dataList" :key="item.id" :title="item.process_name" margin="10px" spacing="0">
			<view class="ctent">货品名称：{{ item.product_name }}</view>
			<view class="ctent">生产单号：{{ item.order_code }}</view>
			<view class="con">
				<view class="ctent">登记数量：{{ item.now_num }}</view>
				<view class="ctent">登记用户：{{ item.register_full_name }}</view>
			</view>
			<view class="con">
				<view class="ctent">工序单价：{{ item.price }}</view>
				<view class="ctent">完成数量：{{ item.up_num }}</view>
			</view>
			<view class="con">
				<view class="ctent">金额总计(元)：{{ item.all_price }}</view>
				<view class="ctent">工资结算：{{ item.if_up_display }}</view>
			</view>
			<view class="ctent">完成时间：{{ item.check_date }}</view>
		</uni-card>
	</z-paging>
</template>
<script setup>
import pCheckApi from '../../../api/production/p_check'
import { reactive, ref, } from 'vue';

const paging = ref(null);
const dataList = ref([]);
const queryParams = reactive({
	search: '',
})
function queryList(pageNo, pageSize) {
	const params = {
		page: pageNo,
		page_size: pageSize,
		status: '2',
		...queryParams
	}
	pCheckApi.get_production_register(params).then((res) => {
		paging.value.complete(res.results);
	})
}
function refreshList() {
	paging.value.reload()
}
</script>

<style lang="scss" scoped></style>